package com.example.demo.topic.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.example.demo.topic.entity.TFansRecord;
import com.example.demo.topic.mapper.TFansRecordMapper;
import com.example.demo.topic.service.TFansRecordService;
import com.example.demo.topic.vo.TFansRecordVo;
import com.example.demo.util.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 粉丝记录表; 服务实现类
 * </p>
 *
 * @author 涛
 * @since 2024-08-01
 */
@Service("tFansRecordService")
public class TFansRecordServiceImpl extends ServiceImpl<TFansRecordMapper, TFansRecord> implements TFansRecordService {

    @Autowired
    TFansRecordMapper tFansRecordMapper;

    /**
     * 获取移动端首页关注内容
     */
    @Override
    public Result<?> getFansByUserId(Page<TFansRecordVo> page, Integer userId) {
        return Result.ok(tFansRecordMapper.getFansByUserId(page,userId));
    }

    /**
     * 获取关注人员数量
     */
    @Override
    public Result<?> getConcernCount(Integer userId) {
        return Result.ok(tFansRecordMapper.getConcernCount(userId));
    }

    /**
     * 获取关注人员服务列表
     */
    @Override
    public Result<?> getConcernList(Page<TFansRecordVo> page, Integer userId) {
        return Result.ok(tFansRecordMapper.getConcernList(page,userId));
    }
}
